package com.epam.lunch.service;

import java.util.List;

import javax.persistence.EntityManager;

import com.epam.lunch.domain.Food;
import com.epam.lunch.domain.Restaurant;

public class JpaRestaurantRepository implements RestaurantRepository {

	private EntityManager manager;
	public JpaRestaurantRepository(EntityManager manager) {
		this.manager = manager;
	}
	@Override
	public List<Restaurant> getAllRestaurants() {
		return manager.createQuery("Select r From Restaurant r", Restaurant.class).getResultList();
	}

	@Override
	public Food findFoodById(long foodId) {
		// TODO Auto-generated method stub
		return null;
	}

}
